﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Wicresoft.RDW.Model;
using Wicresoft.RDW.Interface;
namespace Wicresoft.RDW.Presentation
{
    public class MailPresent : BasePresent<MailTemplate, IMailTemplate>
    {
       /// <summary>
        /// send mail to one people and cc one people
       /// </summary>
       /// <param name="tempName">模板名称</param>
       /// <param name="replaceContent">替换内容</param>
       /// <param name="to">发送对象</param>
       /// <param name="cc">抄送对象</param>
       public static void SendMail(string tempName,string replaceContent,string to,string cc)
       {
           //select body and subject from Name
           var m = GetByCondition(p => p.Name == tempName);
           //present.GetByName(tempName);
           Utility.SendMail mail = new Utility.SendMail(m,tempName, replaceContent, to,cc);
       }
       /// <summary>
       /// send mail to many people and cc many people
       /// </summary>
       /// <param name="tempName">模板名称</param>
       /// <param name="replaceContent">替换内容</param>
       /// <param name="toList">发送对象列表</param>
       /// <param name="ccList">抄送对象列表</param>
       public static void SendMail(string tempName, string replaceContent, List<string> toList, List<string> ccList)
       {
           //select body and subject from Name
           var m = GetByCondition(p => p.Name == tempName);
           Utility.SendMail mail = new Utility.SendMail(m, tempName, replaceContent,toList, ccList);
       }
       /// <summary>
       ///  send mail to many people and cc to one people
       /// </summary>
       /// <param name="tempName">模板名称</param>
       /// <param name="replaceContent">替换内容</param>
       /// <param name="toList">发送对象列表</param>
       /// <param name="cc">抄送对象</param>
       public static void SendMail(string tempName, string replaceContent, List<string> toList, string cc)
       {
           //select body and subject from Name
           var m = GetByCondition(p => p.Name == tempName);
           Utility.SendMail mail = new Utility.SendMail(m, tempName, replaceContent, toList, cc);
       }
       /// <summary>
       /// send mail to one people and cc to many people
       /// </summary>
       /// <param name="tempName">模板名称</param>
       /// <param name="replaceContent">替换内容</param>
       /// <param name="to">发送对象</param>
       /// <param name="ccList">抄送对象列表<</param>
       public static void SendMail(string tempName, string replaceContent, string to, List<string> ccList)
       {
           //select body and subject from Name
           var m = GetByCondition(p => p.Name == tempName);
           Utility.SendMail mail = new Utility.SendMail(m, tempName, replaceContent, to, ccList);
       }
    }
}
